/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: user
 * Date: 2023-11-05
 * Time: 18:57
 */
public class Test {
    public class Dog {
        //姓名
        private String name;
        //年龄
        private int age;
        //颜色
        private String color;

        public Dog() {

        }

        /**
         * 构造方法 用来实例化 狗这个对象
         * @param name
         * @param age
         * @param color
         */
        public Dog(String name, int age, String color) {
            this.name = name;
            this.age = age;
            this.color = color;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        public String getColor() {
            return color;
        }

        public void setColor(String color) {
            this.color = color;
        }

        public void barks() {
            System.out.println(this.name +" 正在汪汪汪叫....");
        }

        public void eat() {
            System.out.println(this.name +" 正在吃狗粮.....");
        }

        public static void staticFun() {
            System.out.println("staticFun.....");
        }

        public void show() {
            System.out.println("狗名："+this.name +" 年龄："+this.age
                    +" 颜色："+this.color);
        }

    /*public String toString() {
        String ret = "狗名："+this.name +" 年龄："+this.age
                +" 颜色："+this.color;
        return ret;
    }*/

        @Override
        public String toString() {
            String ret = "Dog{" +
                    "name='" + name + '\'' +
                    ", age=" + age +
                    ", color='" + color + '\'' +
                    '}';
            return ret;
        }
    }
}
